package text_66;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Code {

	public static void main(String[] args) {
		//随机概率范围
        ArrayList<Integer> list = new ArrayList<>();
        //1 表示是男生的事件
        //0 表示是女生的事件
        //男生的概率是7/10，女生的概率是3/10
        Collections.addAll(list,1,1,1,1,1,1,1,0,0,0);
        //打乱list中的数据
        Collections.shuffle(list);
        Random r = new Random();
        //随机获取list中的数据
        int index = r.nextInt(list.size());
        int number = list.get(index);
        System.out.println(number);
        //创建男生集合
        ArrayList<String> boylist = new ArrayList<>();
        //创建女生集合
        ArrayList<String> girllist = new ArrayList<>();
        //添加数据
        Collections.addAll(boylist,"郭靖","杨过","韦小宝","康熙","尔康","张三","李四");
        Collections.addAll(girllist,"黄蓉","小龙女","双儿");
        //判断 1 为男生集合
        if(number ==1){
            String name = boylist.get(r.nextInt(boylist.size()));
            System.out.println(name);
        }else{
            //0 为女生集合
            String name = girllist.get(r.nextInt(girllist.size()));
            System.out.println(name);
        }


	}

}
